program ParesyNones;


var
    entrada,salida : text;
    pares,nones : boolean;
    cont    : integer;
    st      : string;
    ch      : char;
    i       : integer;

begin
     if ParamCount=0
        then begin
          writeln ('PARNON v1.0. Ricardo Conejo Utilities 1990');
          writeln ('Sintaxis : PARNON entrada [salida] [\p] [\n]');
          Halt;
        end;
     pares := false;
     nones := false;
     for i:=1 to ParamCount do
        begin
          if (pos('\P',ParamStr(i)) > 0) or (pos('\p',ParamStr(i)) > 0)
             then pares := true;
          if (pos('\N',ParamStr(i)) > 0) or (pos('\n',ParamStr(i)) > 0)
             then nones := true;
       end;
    if not(pares) and not(nones)
       then begin
          pares:=true;
          nones:=true;
       end;
    assign  (entrada,ParamStr(1));
    reset   (entrada);
    if (pos('\',ParamStr(2)) > 0) or (ParamStr(2)='')
       then assign  (salida,'PRN')
       else assign  (salida,ParamStr(2));
    rewrite (salida);
    cont := 1;
    while not (eof(entrada)) do
      begin
         read(entrada,ch);
         if ch=#12 then cont:=cont+1;
         if ((cont mod 2) = 1) and nones
             then write(salida,ch);
         if ((cont mod 2) = 0) and pares
             then write(salida,ch);
      end;
    close(entrada);
    close(salida);
end.

